// void, Obj me

Hero this;

this = me.AsUnit();

if(!.IsValid) return;
if (.stamina < cmdcost_stamina) return;
if(.item_count == 0) return;
if(!.HasItem("General")) return;  
if(.HasItem("Leader")) return;

if(!.HasItem("Officer") 
&& !.HasItem("Leader") 
&& .HasItem("General")){
	Item item;

	item = .FindItem("General");
	if(item.IsValid){
		.ExchangeItem(item, "Leader");
	}
	
	if(EnvReadInt(.player, "LeaderOfNation") != 1)
		EnvWriteInt(.player, "LeaderOfNation", 1);
		
	CreateFeedback("DefensiveCry", this, -1);
	
	PlaySound("SOUNDS/NOTIFICATIONS/NOMINATED LEADER.WAV");
	
	.SetStamina(.stamina - cmdcost_stamina);
}
